package net.butfly.bus.client;

import java.io.Serializable;
import java.lang.annotation.Annotation;

import net.butfly.bus.TX;

public class TXRequest implements Serializable, TX {
	private static final long serialVersionUID = 6850073691828769556L;
	private String tx;
	private String ver;

	public TXRequest(String tx, String version) {
		super();
		this.tx = tx;
		this.ver = version;
	}

	public TXRequest(String tx) {
		this(tx, TX.DEFAULT_VERSION);
	}

	public TXRequest(Internal tx) {
		this(tx.getTx());
	}

	public TXRequest(Internal tx, String version) {
		this(tx.getTx(), version);
	}

	@Override
	public Class<? extends Annotation> annotationType() {
		return TXRequest.class;
	}

	@Override
	public String value() {
		return this.tx;
	}

	@Override
	public String version() {
		return this.ver;
	}
}
